请从如下四个选项中选出你认为正确的答案(单选题)
你选择了答案
/**************后台*************/ protected void Page_Load(object sender, EventArgs e) { } protected void RadioButton1_CheckedChanged(object sender, EventArgs e) { if (RadioButton1.Checked == true) { this.Label1.Text = "A"; } } protected void RadioButton2_CheckedChanged(object sender, EventArgs e) { if (RadioButton2.Checked ==true) { this.Label1.Text = "B"; } } protected void RadioButton3_CheckedChanged(object sender, EventArgs e) { if (RadioButton3.Checked == true) { this.Label1.Text = "C"; } } protected void RadioButton4_CheckedChanged(object sender, EventArgs e) { if (RadioButton4.Checked == true) { this.Label1.Text = "D"; } } protected void Button1_Click(object sender, EventArgs e) { //判断用户是否已选择了答案,如果没有作出选择,弹出对话框,提示用户选择答案 if (RadioButton1.Checked == false && RadioButton2.Checked == false && RadioButton3.Checked == false && RadioButton4.Checked == false) { Response.Write(""); } else if (RadioButton4.Checked == true) { Response.Write(""); } else { Response.Write(""); } } /***********多选按钮**********/
请从如下四个选项中选出你认为正确的答案(多选题)
 
 
 
 
你选择的答案是:
/***********多选按钮后台**********/ protected void Button1_Click(object sender, EventArgs e) { //判断用户是否已选择了答案,如果没有作出选择,弹出对话框,提示用户选择答案 if (CheckBox1.Checked == false && CheckBox2.Checked == false && CheckBox3.Checked == false && CheckBox4.Checked == false) { Response.Write(""); } else if (CheckBox1.Checked == true && CheckBox2.Checked == true && CheckBox3.Checked == true && CheckBox4.Checked == false) { Response.Write(""); } else { Response.Write(""); } } protected void CheckBox1_CheckedChanged(object sender, EventArgs e) { if (CheckBox1.Checked == true) { this.Label1.Text = "A"; } else { this.Label1.Text = ""; } } protected void CheckBox2_CheckedChanged(object sender, EventArgs e) { if (CheckBox2.Checked == true) { this.Label2.Text = "B"; } else { this.Label2.Text = ""; } } protected void CheckBox4_CheckedChanged(object sender, EventArgs e) { if (CheckBox4.Checked == true) { this.Label4.Text = "D"; } else { this.Label4.Text = ""; } } protected void CheckBox3_CheckedChanged(object sender, EventArgs e) { if (CheckBox3.Checked == true) { this.Label3.Text = "C"; } else { this.Label3.Text = ""; } }